package de.koller.million.grid.frame.enc;

import de.koller.million.grid.GNode;
import de.koller.million.grid.commands.RemoveGNode;
import de.koller.million.grid.engine.enc.Encounter;

public class EncounterFrame extends GNode {
	
	public final EncounterFrameComp comp;
	public final Encounter encounter;
	
	public EncounterFrame( Encounter enc ) {
		this.encounter = enc;
		comp = new EncounterFrameComp( this );
	}

	@Override
	protected void update( int elapsedTime ) {
		super.update( elapsedTime );
		
		comp.repaint();
	}
	
	@Override
	protected void init() {
		super.init();
		
		comp.setVisible( true );
	}

	@Override
	protected void release() {
		super.release();
		
		comp.dispose();
		groot.frame.disShowEncounter();
	}
	
	public void closeThis() {
		groot.call( new RemoveGNode( this ) );
	}
	
}
